package unit5.part8;

public class MemberLocalInnerTest {
    public static void main(String[] args) {
        Outer outer = new Outer();
        outer.show();
        outer.power();
        Outer.MemberInner memberInner = new Outer().new MemberInner(1.2f);
        memberInner.printInfo();
    }
}

class Outer {
    String name = "MaiBaHe";

    class MemberInner {// 编号
        float code;

        public MemberInner(float code) {
            this.code = code;
        }

        void printInfo() {
            System.out.println(name + ":" + code);
        }
    }

    void show() {
        MemberInner memberInner = new MemberInner(1.1f);
        memberInner.printInfo();
    }

    void power() {// 动力系统
        class LocalInner {// 核心系统

            String engine() {
                MemberInner memberInner = new MemberInner(1.0f);
                return name + "V" + memberInner.code + "的核心引擎";
            }
        }
        LocalInner localInner = new LocalInner();
        System.out.println(localInner.engine());
    }
}
